# -*- coding=utf-8 -*-

from framework.mongo import MongoModel

class TaskModel(MongoModel):
    """ task model """

    def __init__(self):
        """super init"""
        super(TaskModel, self).__init__()

    def return_coll(self):
        """return databae name and collection name"""
        return 'fuwa', 'sync'

    def get_sync(self):
        """get sync list"""
        last = self.find().sort([('sync_time', -1)])[0:1]
        if last:
            return last[0]
        return
